#include <iostream>
#include <queue>
const int N =1e5 + 10;
using namespace std;
using ll = long long;
ll n , k;
// key 为吃桃子之后的羞耻值， value为吃桃子的天数
// 羞耻值越小越好
struct lessShy{
  bool operator()
      (const std::pair<ll, ll>& x, 
       const std::pair<ll, ll>& y){
      return x.first > y.first;
  }
};

priority_queue<pair<ll, ll>, 
vector<pair<ll, ll>>, 
lessShy> hq;
// 前缀和
ll a[N], b[N];


void clear(){
    while(hq.size()){
        hq.pop();
    }
}
int main(){
    
    cin >> n >> k;
    
    for (int i = 1; i <= n; i++){
        int x; scanf("%d", &x);
        a[i] = a[i - 1] + x;
    }
    for (int i = 1; i <= n; i++){
        int x; scanf("%d", &x);
        b[i] = b[i - 1] + x;
    }
//     接下来枚举每一次吃桃子的天数
    ll ret = -1;
    ll mh = 0;
    for (int i = 1; i <= n - k + 1; i++){
        ll vh = a[i + k - 1] - a[i - 1];
//         计算羞耻值
        ll shy = b[i + k - 1] - b[i - 1];
        if (vh > mh){
//             此时出现了更大的hm，更新并维护队列信息
            clear();
            hq.emplace(shy, i);
            mh = vh;
        }else if(vh == mh){
            hq.emplace(shy, i);
        }
    }
    
//     出来之后就获得了最大mh 下的羞耻 和 天数
    auto [shy, day] = hq.top();
    ret = day;
    hq.pop();
    while (hq.size()){
        auto [x, y] = hq.top();
        if (shy == x && ret > y){
            ret = y;
        }else if (shy != x) break;
        
        hq.pop();
    }
    
    cout << ret << endl;
    
    return 0;
}